package org.ucn.dmaa0914.temadesign.group2.modelLayer;

/**
 * The Person class represents a person which can borrow DVDs. It contains
 * information about that person.
 * 
 * @author Kim Johannsen 
 * @version 04-11-2014
 */
public class Person
{
    // Id counter for making unique id's
    private static int idCounter = 0;
    
    private int id;
    private String name;
    private String address;
    private String phone;
    private String email;
    private int zipCode;
    private String city;

    /**
     * Constructor for objects of class Person
     */
    public Person(String name, String address, int zipCode, String city, String phone, String email)
    {
        // initialise instance variables and assign a new id
        this.id = idCounter++;
        this.name = name;
        this.address = address;
        this.zipCode = zipCode;
        this.city = city;
        this.phone = phone;
        this.email = email;
    }
    
    public String toString()
    {
        return name + " @ " + phone;
    }
    
    public String makeDescription()
    {
        return "ID: " + String.valueOf(getId()) + "\n" +
               "Name: " + getName() + "\n" +
               "Address: " + getAddress() + "\n" +
               "Zip Code: " + String.valueOf(getZip()) + "\n" +
               "City: " + getCity() + "\n" +
               "Phone: " + getPhone() + "\n" +
               "E-mail: " + getEmail();
    }

    /** id accessor */
    public int getId()
    {
        return id;
    }
    
    /** zip accessor */
    public int getZip()
    {
        return zipCode;
    }

    /** name accessor */
    public String getName()
    {
        return name;
    }
    
    /** address accessor */
    public String getAddress()
    {
        return address;
    }
    
    /** city accessor */
    public String getCity()
    {
        return city;
    }
    
    /** phone accessor */
    public String getPhone()
    {
        return phone;
    }
    
    /** email accessor */
    public String getEmail()
    {
        return email;
    }
    
    /** id mutator */
    public void setId(int value)
    {
        this.id = value;
    }
    
    /** zip mutator */
    public void setZip(int value)
    {
        this.zipCode = value;
    }

    /** name mutator */
    public void setName(String value)
    {
        this.name = value;
    }
    
    /** address mutator */
    public void setAddress(String value)
    {
        this.address = value;
    }
    
    /** city mutator */
    public void setCity(String value)
    {
        this.city = value;
    }
    
    /** phone mutator */
    public void setPhone(String value)
    {
        this.phone = value;
    }
    
    /** email mutator */
    public void setEmail(String value)
    {
        this.email = value;
    }
    
}
